local skel = fk.CreateSkill {
  name = "emo__duce",
}

local slash_name = function ()
  if Fk.all_card_types["wd_poison__slash"] then
    return "wd_poison__slash"
  end
  return "slash"
end

skel:addEffect("active", {
  card_num = 0,
  card_filter = Util.FalseFunc,
  min_target_num = 1,
  prompt = "#emo__duce",
  target_filter = function (self, player, to_select, selected, selected_cards)
    return #selected < player:getHandcardNum() and to_select ~= player
    and not player:isProhibited(to_select, Fk:cloneCard(slash_name()))
  end,
  times = function (self, player)
    return 1 - player:usedSkillTimes(skel.name, Player.HistoryPhase)
  end,
  can_use = function(self, player)
    return player:usedSkillTimes(skel.name, Player.HistoryPhase) == 0 and not player:isKongcheng()
    and not player:prohibitUse(Fk:cloneCard(slash_name()))
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    player:throwAllCards("h", skel.name)
    room:useVirtualCard(slash_name(), nil, player, effect.tos, skel.name, true)
  end,
})

skel:addEffect(fk.Damage, {
  is_delay_effect = true,
  mute = true,
  can_trigger = function(self, event, target, player, data)
    return data.card and table.contains(data.card.skillNames, skel.name) and target == player and not player.dead
  end,
  on_cost = Util.TrueFunc,
  on_use = function(self, event, target, player, data)
    local room = player.room
    player:drawCards(2, skel.name)
    if not player.dead and player:isWounded() then
      room:recover { num = 1, skillName = skel.name, who = player, recoverBy = player }
    end
  end,
})

skel:addEffect(fk.CardEffectCancelledOut, {
  is_delay_effect = true,
  mute = true,
  can_trigger = function(self, event, target, player, data)
    return table.contains(data.card.skillNames, skel.name) and target == player and not player.dead
  end,
  on_cost = Util.TrueFunc,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:loseHp(player, 1, skel.name)
    if not player.dead then
      player:turnOver()
    end
  end,
})

Fk:loadTranslationTable{
  ["emo__duce"] = "毒策",
  [":emo__duce"] = "出牌阶段限一次，你可以弃置所有手牌，视为对至多等量名其他角色使用一张无距离和次数限制的毒【杀】，每当此【杀】造成伤害后，你摸两张牌并回复一点体力；此【杀】被抵消时，你失去1点体力并翻面。",
  ["#emo__duce"] = "毒策：弃置所有手牌，视为对至多等量名其他角色使用毒【杀】",
}


return skel
